package edu.csl.study.coreserver2.feign;
import edu.csl.study.coreserver2.config.FeignConfiguration;
import edu.csl.study.coreserver2.vo.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;

/**
 * Description: 服务接口
 * name:远程服务名，即服务提供者spring.application.name中配置的名称
 * 此类中的方法和远程服务中Contoller中的方法名和参数需保持一致。
 */
@FeignClient(name = "istio-server1",fallbackFactory = MyFeignClientFallback.class,primary = true)
public interface MyFeignClient {
    @RequestMapping(value = "/hello")
    public String hello();

    @GetMapping(value = "/user/get")
    public String updateUser3(@RequestParam String userName,@RequestParam String password);

    @PostMapping(value = "/user/post",consumes = MediaType.APPLICATION_JSON_VALUE)
    public String updateUser2(@RequestBody User user);
}